Inheritence & Float- ECLoc5490 140_Inheritance_and_Float.html

All elements are descendants of the body element, and in this a div wraps around everything inside the. Digging deeper,the em and small elements are contained with the the p element and thus are descendants of p (and div and body, as the diagram illustrates.

Inheritence_0

It is easy to see which elements are descendants of other when you visualize an HTML page as tree structure. Each element that is inside another immediate element in the code - for example, as img is inside div - is a branch of its parent.

A list of inherited properties are list on ECLoc5561.

One isn't limited to defining styles with the basic selectors shown in the examples. Chapter 9 covers other selector types of varying specificity weights. Among those, note that id selectors are considered the most specific by a vast margin (since each id must be unique in an HTML page)

'margin-left: 2em' states that a left margin be set to twice the font size of the element.

vspsce4

I stopped here: ECLoc5761